package org.example.salesystem.service.impl;

import org.example.salesystem.entity.ResultBody;
import org.example.salesystem.mapper.ShopManMapper;
import org.example.salesystem.service.ShopManService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ShopManServiceimpl implements ShopManService {
    @Autowired
    private ShopManMapper shopManMapper;
    @Override
    public ResultBody updateShop2(String code,String name,String description,double price,String category,String phone,String avatar_Url)
    {
        if(shopManMapper.updateShop2(code,name,description,price,category,phone,avatar_Url)>0)
        {
            return new ResultBody(200,"修改成功",true);
        }
        else
            return new ResultBody(400,"修改失败",false);
    }
    @Override
    public ResultBody updateShop1(String code,String name,String description,String category,String phone,String avatar_Url)
    {
        if(shopManMapper.updateShop1(code,name,description,category,phone,avatar_Url)>0)
        {
            return new ResultBody(200,"修改成功",true);
        }
        else
            return new ResultBody(400,"修改失败",false);
    }

    @Override
    public int DeMessage(String code)
    {
        if(shopManMapper.DeMessage(code)>0)
            return 1;
        else
            return 0;
    }
}
